$(function() {
	$('#vue_vm_list div').hide();
});

var elderOutOrder = {
	elderOutOrderId: '',
	elderId: '',
	orderTime: '',
	status: '',
	createTime: '',
	updateTime: '',
	createId: getLoginedUser()? getLoginedUser().staffId: '',
	updateId: getLoginedUser()? getLoginedUser().staffId: '',
	remark: '',
	subjectRoomId: getLoginedUser().subjectRoomId,
	subjectRoomName: getLoginedUser().subjectRoomName,
	beHospitalId: ''
};

var view = {
	data: elderOutOrder
};

if($('#vue_vm').length > 0) {
	var vue_vm = new Vue({
		el: '#vue_vm',
		data: view
	});
}

function save() {
	var selectedElderBeHospital = getSelectedElderBeHospital;
	elderOutOrder.orderTime = getStandardDay($('#orderYear').val(), $('#orderMonth').val(), $('#orderDay').val());
	elderOutOrder.status = 0;
	elderOutOrder.elderId = elderBeHospital.elderForm.elderId;
	elderOutOrder.beHospitalId = elderBeHospital.beHospitalId;

	save_basic(path+'/elderOutOrder/save', {elderOutOrder:elderOutOrder}, function() {
		alert('保存成功');
	});
}

function findAll() {
	if($('#vue_vm_list').length==0) {return;}
	$('#vue_vm_list div').hide();

	find_basic_by_json(path+'/elderOutOrder/findAll',{status:1}, function(response) {
		$('#vue_vm_list').html(gl_vue_vm_list_html);
		
		new Vue({
			el: '#vue_vm_list',
			data: {
				todos: response.data
			}
		});
		
		$('#vue_vm_list div').show();
	});
}

function deleteBatch() {
	deleteBatch_basic(path+'/elderOutOrder/deleteBatch');
}
